<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板字符串</title>
    <style>
        ul{
            width: 200px;
            height: 200px;
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <ul id="list">
        <li>正在加载中.........</li>
    </ul>
    <script>
        var list=document.getElementById('list');
        var student=[
            {
                name:'张三',
                age:18,
                sex:'male'
            },
            {
                name:'李四',
                age:18,
                sex:'male'
            },
            {
                name:'王五',
                age:18,
                sex:'male'
            }
        ];
        var html='';
        for(var i=0;i<3;i++){
             html+=`<li>姓名${student[i].name},年龄${student[i].age},性别${student[i].sex}</li>`;
        }
        list.innerHTML=html;
    </script>
</body>
</html>